/**
 * @param {Function|Object} baseClass
 * @see http://phrogz.net/JS/classes/OOPinJS2.html
 * @return {*}
 */
Function.prototype.inherit = function(baseClass)
{
	if (baseClass.constructor == Function)
	{
		// normal Inheritance
		this.prototype = new baseClass;
		this.prototype.constructor = this;
		this.prototype.base = baseClass.prototype;
	}
	else
	{
		// pure Virtual Inheritance
		this.prototype = baseClass;
		this.prototype.constructor = this;
		this.prototype.base = baseClass;
	}
	return this;
};

if (!Function.prototype.bind)
{
	/**
	 * @param context
	 * @see http://clubajax.org/javascript-context-call-and-bind-ninja-level/
	 * @see http://stackoverflow.com/questions/2025789/preserving-a-reference-to-this-in-javascript-prototype-functions
	 * @return {Function}
	 */
	Function.prototype.bind = function(context)
	{
		var fn = this;
		return function() { return fn.apply(context, arguments); }
	}
}